package com.atguigu;

import org.apache.log4j.Logger;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;


/**
 * 在springboot中使用log4j
 */
@RunWith(SpringRunner.class)
@SpringBootTest
public class ApplicationTestslog4j {
    private static Logger logger = Logger.getLogger(ApplicationTestslog4j.class);

    @Test
    public void contextLoads() {
    // 记录debug级别的信息
        logger.debug("This is debug message.");
        // 记录info级别的信息
        logger.info("This is info message.");
        // 记录error级别的信息
        logger.error("This is error message.");

    }

}

